package thread;

import souket.thread;

import java.util.Scanner;

public class SleepDemo2 {
    public static void main(String[] args) {
        Thread lin=new Thread("林永建"){
            @Override
            public void run() {
                try {
                    Thread.sleep(500000000);
                } catch (InterruptedException e) {
                    System.out.println(getName()+"咋啦！咋啦！吵老子睡觉！！！！");
                }
                System.out.println(getName()+"醒啦");
            }
        };
        Thread huang=new Thread("黄大锤"){
            @Override
            public void run() {
                System.out.println(getName()+"大锤80，小锤40，开始砸墙！");
                for(int i = 0; i < 10; i++) {
                    System.out.println(getName()+":80");
                    if(i==6){
                        lin.interrupt();
                    }
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();

                    }
                }
                System.out.println("哐当");
                System.out.println(getName()+"大哥搞定！");
            }

        };
        lin.start();
        huang.start();

    }
}
